<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/production/production/MES_Production.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/production/production/MES_Production.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '生产管理',
                name: 'production/MES_Production',
                url: "/MES_Production/",
                sortName: "id"
            });
            const editFormFields = ref({"contract_no":"","jiaohuo_date":"","plan_start":"","plan_end":"","kh_name":"","important":"","p_number":"","comment":""});
            const editFormOptions = ref([[{"title":"合同号","field":"contract_no","type":"text"},
                               {"title":"交货日期","field":"jiaohuo_date","type":"datetime"}],
                              [{"title":"计划开始时间","required":true,"field":"plan_start","type":"datetime"},
                               {"title":"计划结束时间","required":true,"field":"plan_end","type":"datetime"}],
                              [{"title":"客户","field":"kh_name","type":"text"},
                               {"dataKey":"重要程度","data":[],"title":"重要程度","field":"important","type":"select"}],
                              [{"title":"生产编号","field":"p_number","type":"text"},
                               {"title":"备注","field":"comment","type":"text"}]]);
            const searchFormFields = ref({"p_number":"","o_number":"","contract_no":"","kh_name":"","status":"","is_ruku":"","comment":""});
            const searchFormOptions = ref([[{"title":"生产编号","field":"p_number","type":"like"},{"title":"订单编号","field":"o_number","type":"like"},{"title":"合同号","field":"contract_no","type":"like"},{"title":"客户","field":"kh_name","type":"like"},{"dataKey":"生产状态","data":[],"title":"生产状态","field":"status","type":"select"},{"dataKey":"入库状态","data":[],"title":"入库状态","field":"is_ruku","type":"select"}],[{"title":"备注","field":"comment","type":"like"}]]);
            const columns = ref([{field:'id',title:'id',type:'int',width:110,readonly:true,require:true,align:'left',sort:true},
                       {field:'p_number',title:'生产编号',type:'string',width:220,align:'left'},
                       {field:'o_number',title:'订单编号',type:'string',width:220,align:'left'},
                       {field:'o_id',title:'订单ID',type:'string',width:220,hidden:true,align:'left'},
                       {field:'contract_no',title:'合同号',type:'string',width:220,align:'left'},
                       {field:'kh_id',title:'客户ID',type:'int',width:110,hidden:true,align:'left'},
                       {field:'kh_name',title:'客户',type:'string',width:220,align:'left'},
                       {field:'plan_start',title:'计划开始时间',type:'string',width:220,require:true,align:'left'},
                       {field:'plan_end',title:'计划结束时间',type:'string',width:220,require:true,align:'left'},
                       {field:'actual_start',title:'实际开始时间',type:'string',width:220,align:'left'},
                       {field:'actual_end',title:'实际结束时间',type:'string',width:220,align:'left'},
                       {field:'p_status',title:'状态',type:'string',width:220,align:'left'},
                       {field:'status',title:'生产状态',type:'string',bind:{ key:'生产状态',data:[]},width:220,align:'left'},
                       {field:'is_ruku',title:'入库状态',type:'string',bind:{ key:'入库状态',data:[]},width:220,align:'left'},
                       {field:'create_time',title:'创建时间',type:'string',width:220,hidden:true,align:'left'},
                       {field:'important',title:'重要程度',type:'int',bind:{ key:'重要程度',data:[]},width:110,align:'left'},
                       {field:'comment',title:'备注',type:'string',width:220,align:'left'},
                       {field:'jiaohuo_date',title:'交货日期',type:'string',width:220,hidden:true,align:'left'},
                       {field:'old_status',title:'原状态',type:'string',width:220,hidden:true,align:'left'},
                       {field:'finish_status',title:'完成状态',type:'string',width:220,hidden:true,align:'left'},
                       {field:'is_wuxianzhi',title:'是否无限制',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
